//
//  HSImageUploader.h
//  AFNetworking
//
//  Created by huang on 2018/8/16.
//

#import <Foundation/Foundation.h>

typedef void(^ImageUploaderProgressBlock)(NSProgress *uploadProgress);
typedef void(^ImageUploaderSuccessBlock)(id responseObject);
typedef void(^ImageUploaderFailureBlock)(NSError *error);

@interface HSImageUploader : NSObject

/**
 取消所有请求
 */
+ (void)cancelAllRequest;

+ (instancetype)shareManager;

/**
 上传路径
 */
@property (nonatomic,copy) NSString *uploaderPath;

/**
 参数
 */
@property (nonatomic,copy) id params;

/**
 压缩系数,默认为0.28
 */
@property (nonatomic,assign) CGFloat compressionQuality;

/**
 与服务器约定好的字符串,可以是picture/image/file 等,默认为 file
 */
@property (nonatomic,copy) NSString *tagName;

/**
 Mine 类型
 */
@property (nonatomic,copy) NSString *mineType;


/**
 上传单张图片
 
 @param image image
 @param success 成功回调
 @param failure 失败回调
 */
- (void)imageUploader:(UIImage *)image success:(ImageUploaderSuccessBlock)success failure:(ImageUploaderFailureBlock)failure;
- (void)imageUploader:(UIImage *)image progress:(ImageUploaderProgressBlock)progress success:(ImageUploaderSuccessBlock)success failure:(ImageUploaderFailureBlock)failure;


/**
 同时上传多张图片

 @param images images
 @param success 成功回调
 @param failure 失败回调
 */
- (void)imageUploaderWithImages:(NSArray *)images success:(ImageUploaderSuccessBlock)success failure:(ImageUploaderFailureBlock)failure;
- (void)imageUploaderWithImages:(NSArray *)images progress:(ImageUploaderProgressBlock)progress success:(ImageUploaderSuccessBlock)success failure:(ImageUploaderFailureBlock)failure;

@end
